#ifndef BROWSERTREEWIDGET_H
#define BROWSERTREEWIDGET_H

#include "model/BrowserTreeModel.h"
#include <QStandardItem>
#include <QWidget>
class QTreeView;

const int nodetype_role = Qt::UserRole+10;

class BrowserTreeWidget : public QWidget
{

public:

    explicit BrowserTreeWidget();

    explicit BrowserTreeWidget(QWidget *parent = 0);


    ~BrowserTreeWidget();

private slots:

    void on_treeView_clicked(
        const QModelIndex &index);

private:

    nodeInfoList m_infoList;
    QStandardItemModel *m_treeview_model;

    void initNodeInfoList();
    void initUi();

    void getAllItem(QStandardItem *item, QList<QStandardItem *> &item_list);
    bool isMainItem(const QModelIndex &index);

private:

     QTreeView* treeView;

};

#endif // BROWSERTREEWIDGET_H
